package com.geekaca.d4.regx;

public class TestPhone {
    public static void main(String[] args) {
        System.out.println(checkMobilePhone("13928406381"));

        System.out.println(checkEmail("dydx@163.com.cn"));
    }

    public static boolean checkMobilePhone(String phoneNumber) {
//        return phoneNumber.matches("1[3-9][0-9]{9}");
        return phoneNumber.matches("1[3-9]\\d{9}");
    }

    public static boolean checkEmail(String email) {
        String rule = "[a-zA-Z0-9]{1,30}@[a-zA-z0-9]{2,20}\\.[a-z]{2,3}(\\.[a-zA-Z0-9]{2}){0,1}";
        return email.matches(rule);

    }
}
